package com.chebaohui.iqs.service.impl.deal.bihu.num;

import com.alibaba.druid.support.logging.Log;
import com.alibaba.druid.support.logging.LogFactory;
import com.alibaba.fastjson.JSONObject;
import com.chebaohui.iqs.config.BiHuConfig;
import com.chebaohui.iqs.service.impl.deal.bihu.entity.req.ReqCommon;
import com.chebaohui.iqs.service.impl.deal.bihu.utils.BHHttpClientUtil;
import com.chebaohui.iqs.service.impl.deal.bihu.utils.GetUrlUtil;

/**
 * 对应壁虎10号接口 作用：获取每个城市配置的渠道 说明：获取每个城市下配置的渠道 输出json
 * 
 * @author yuanxu
 *
 */
public class TenInterface {

	/**
	 * log:日志输出
	 */
	private static Log log = LogFactory.getLog(TenInterface.class);

	/**
	 * 壁虎10好接口 查询车辆信息
	 * 
	 * @param obj
	 *            传入一个javabean
	 * @return json格式数据
	 * @throws Exception
	 */
	public JSONObject ten(ReqCommon obj) {
		log.info("\n" + "进入壁虎第10号接口。。。。。" + "\n" + "开始获取每个城市下配置的渠道");
		JSONObject result = null;
		try {
			String newurl = GetUrlUtil.getUrl(obj, BiHuConfig.TenUrl);
			String org = BHHttpClientUtil._httpGetToBody(newurl);
			log.info("\n" + "城市查询" + "\n" + "请求参数：" + JSONObject.toJSONString(obj) + "\n" + "请求get-URL：" + newurl + "\n"
					+ "返回结果：" + org + "\n" + "结束壁虎第10号接口。。。。");
			result = JSONObject.parseObject(org);
			return result;
		} catch (Exception e) {
			log.error("\n" + "壁虎10号接口错误:" + e.getMessage());
		}
		return result;
	}
}
